/**
 * copyright © geolabs
 * author : Gérald Fenoy
 */

Graphic=Class.create();
Graphic.define({

  _init: function(){ _root=null; },

      _caller: function(){
      return arguments[0].apply(this,arguments[1]);
    },

  _callers: {
    display: function(){},
    move: function(){},
    resize: function(){},
    },

  addElement: function(composant){ composant.father=this; },
  removeElement: function(composant){},
  getChild: function(index){},
  getRoot: function(){ return this._root; }
    
  });

MultipleGraphic=Composant.extend();
MultipleGraphic.define({

  _init: function(){
      this._superCall("init");
      this.children=new Array();
    },

  _callers: {
    display: function(){
	for(i=0;i<this.children.length;i++)
	  this.children[i].display();
      },
    move: function(){
	for(i=0;i<this.children.length;i++)
	  this.children[i]._calers.display();
      },
    resize: function(){
	for(i=0;i<this.children.length;i++)
	  this.children[i]._calers.resize();
      },
	},

  addElement: function(composant){
      this._superCall("addElement",arguments);
      this.children[this.children.length]=composant;
    },
      
  delElement: function(composant){
      j=0;
      var newchildren=new Array();
      for(i=0;i<this.children.length;i++)
	if(this.children[i]!=composant){
	  newChildren[j]=this.children[i];
	}
	else
	  delete(this.children[i]);
      this.children=newChildren;
    },
      
  getChild: function(index){
      return this.children[index];
    }
      
  });

